using Microsoft.Unity.VisualStudio.Editor;
using UnityEngine;
using UnityEngine.EventSystems;

public class Hover : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerUpHandler
{
    

    [SerializeField] float scaleChange = 1.2f;
    [SerializeField] AudioSource source;
    private Vector3 baseSize;
    void Start()
    {
        baseSize=gameObject.transform.localScale;
        
    }
    public void OnPointerEnter(PointerEventData eventData)
    {
        transform.localScale *= scaleChange;
        if (source.clip == null) return;
        source.PlayOneShot(source.clip);
    }

    public void OnPointerExit(PointerEventData eventData)
    {
        transform.localScale = baseSize;

    }

    public void OnPointerUp(PointerEventData eventData)
    {
        transform.localScale = baseSize;
    }

    
}
